<%--
  Created by IntelliJ IDEA.
  User: HZW
  Date: 2021/4/22
  Time: 14:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>navigation bar util</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/layout.css">
    <link rel="stylesheet" href="css/managementLayout.css">
    <script src="js/jquery1.12.4.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/monitor.js"></script>
    <script src="js/slider.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>

<div class="sidebar public-main-left" id="app">
    <ul class="sidebar-menu">
        <!-- <li class="header">主导航</li> -->
        <li class='sidebar-menu-header'>
            <img src='./img/logo.png' />
            <span>后台管理系统</span>
        </li>
        <li class="treeview">
            <a href="index.jsp">
                <i class="fa fa-dashboard"></i> <span>主  页</span> <i class="fa fa-angle-right pull-right"></i>
            </a>
        </li>
        <li class="header">后台管理</li>
        <c:forEach items="${RiOneList}" var="one">
            <li class="treeview">
                <a href="javascript:void(0)" @click.prevent="showRight(${thisAccount.userCode},${one.rightId})">
                    <i class="fa fa-dashboard"></i> <span>${one.rightName}</span>
                    <i class="fa fa-angle-right pull-right"></i>
                </a>
                <ul class="treeview-menu">
                        <li v-for="obj in riTwoList"><a :href="obj.url"><i class="fa fa-circle-o"></i>{{obj.rightName}}</a></li>
                </ul>
            </li>
        </c:forEach>
        <c:if test="${!empty RecOneList}">
            <li class="header">前台管理</li>
            <c:forEach  items="${RecOneList}" var="RecOne">
                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-dashboard"></i> <span>${RecOne.rightName}</span>
                        <i class="fa fa-angle-right pull-right"></i>
                    </a>
                </li>
            </c:forEach>
        </c:if>
    </ul>
</div>

</body>
<script type="text/javascript">
    new Vue({
        el:"#app",
        data:{
            riTwoList:{}
        },
        methods:{
            showRight:function (id,superId) {
                var _this=this;
                axios.get("/account/showRightTwo",{
                    params:{
                        id:id,
                        superId:superId,
                    }
                })
                .then(function (response) {
                    _this.riTwoList=response.data
                })
                .catch(function (error) {
                    console.log(error)
                })
            }
        }

    })
</script>
</html>
